﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FOBTV.Web.FOBTV2011
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((FOBTV.Web.MainClass.SessionState.CurrentUser != null) && (FOBTV.Web.MainClass.SessionState.CurrentUser.State != 0))
            {
                string info = "";
                if (FOBTV.Web.MainClass.SessionState.CurrentUser.LastName.Trim().Length > 0)
                {
                    info = string.Format("Welcome {0} {1} !", FOBTV.Web.MainClass.SessionState.CurrentUser.FirstName, FOBTV.Web.MainClass.SessionState.CurrentUser.LastName);
                }
                else
                {
                    info = string.Format("Welcome {0} !", FOBTV.Web.MainClass.SessionState.CurrentUser.FirstName);
                }
             
                this.LabelWelcome.Text = info;
                this.DivLogOut.Visible = true;
                this.DivLogin.Visible = false;

            }
            else
            {
                this.LabelWelcome.Text = "";
                this.DivLogOut.Visible = false;
                this.DivLogin.Visible = true;
            }
        }

        protected void Logut_Click(object sender, EventArgs e)
        {
            HttpContext.Current.Session.Clear();
            FOBTV.Web.MainClass.SessionState.ClearSession();
            this.Page_Load(sender, e);
            Response.Redirect("index.aspx");
        }

        protected void BtnFOBTV_Click(object sender, EventArgs e)
        {
             Response.Redirect("en/RegistrationFee_en.aspx");
        }




    }
}